import { Button, Modal ,Result } from 'antd';
import { useStore } from '../useStore';
import Router from "next/router"

export const ResultModal = () => {
  const [resultModal] = useStore((state)=>[
    state.resultModal
  ])
  const handleCancel = () =>{
    useStore.setState({resultModal:{open:false}})
  }
  const toHome = () =>{
		Router.push('/eb/performanceManagement/personalCenter');
  }
  return(
    <Modal open={resultModal.open} onCancel={handleCancel} footer={null}
    >
      <Result
        status="success"
        title="提交成功!"
        subTitle="表单提交成功"
        extra={[
          <Button onClick={handleCancel}>查看个人信息</Button>,
          <Button type="primary" onClick={toHome}>
            返回个人中心
          </Button>,
        ]}
      />
    </Modal>
  )
}